<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function answer() {
            //根据id获取对应元素
            var spanObj = document.getElementById("infoSpan")
            //设置标签中间的文字
            spanObj.innerHTML = "打瞌睡";
            //设置标签文本的颜色
            spanObj.style.color = "red";
            //设置标签的背景色为黄色，样式中有横杠，则采用驼峰命名法
            spanObj.style.backgroundColor="yellow";
            spanObj.style.fontSize="12px";
        }
        function he(){
        var a=   document.getElementById("Span")
            a.innerHTML="5";
        }

    </script>
</head>
<body>
<input type="button" value="打什么不费力气" onclick="answer()">
<input type="button" value="3+2等于几" onclick="he()">
<span id="Span">  </span><br>
<span id="infoSpan"> </span>
</body>
</html>